function bedProduct() {
	var link = document.location.href;
	if (link.search("&&bed") < 0) {
		window.location = link + "&&pgroup=bed";
	}
}

function dollProduct() {

	window.location = document.location.href + "&pgroup=doll";
}

function etcProduct() {
	// window.location = document.location.href+"&pgroup=etc";
}

function findPPF() {
	var n = document.getElementById("w").value;
	var cost = document.getElementById("cost").value;
	var ppf = cost / n;

	if (document.getElementById("ppf").value == "") {
		document.getElementById("ppf").value = ppf;
	}
}

function findPrice(cost) {
	var price = 1.5 * cost;
	document.getElementById("price").value = price;

}

function findProductName(mode) {
	var brand = document.getElementById("brand").value;
	var fill = document.getElementById("fill").value;
	var w = document.getElementById("w").value;
	var l = document.getElementById("l").value;
	var h = document.getElementById("h").value;
	var fabric = document.getElementById("fabric").value;
	switch (mode) {
		case 'b': {
			document.getElementById("pname").value = "ที่นอน "+brand+" "+fill+" "+w+" x "+l+" x "+h+" ผ้า"+fabric;
		} break;
		case 'd': {
			
		} break;
	}
}

function getFillNum(fillNum) {
	var link = document.location.href;
	if (link.search("&fillNum") < 0) {
		window.location = link + "&fillNum=" + fillNum;
	}
}

function checkIn(noItem) {
	var link = document.location.href;
	if (link.search("&&noItem") < 0) {
		window.location = link + "&&noItem=" + noItem;
	}
}

function test() {
	alert(document.location.href);
}
